
	/**
	 * [将数字保留两位小数]
	 * @Author   juming
	 * @DateTime 2021-01-22T14:34:59+0800
	 * @param    {[type]}                 val [description]
	 * @return   {[type]}                     [description]
	 */
	const my_number_format = function(val){
		return parseFloat(val).toFixed(2)
	}

	/**
	 * [将时间戳格式化为YYYY-MM-DD HH:II]
	 * [需要先将时间戳 * 1000，否则一直是1970年]
	 * @Author   juming
	 * @DateTime 2021-01-22T14:35:39+0800
	 * @param    {[type]}                 val [description]
	 * @return   {[type]}                     [description]
	 */
	const my_date_format = function(val){
		let timestamp = parseInt(val) * 1000
		let date = new Date(timestamp);
	  let seperator1 = "-";
	  let seperator2 = ":";
	  let month = date.getMonth() + 1;
	  let strDate = date.getDate();
	  if (month >= 1 && month <= 9) {
	      month = "0" + month;
	  }
	  if (strDate >= 0 && strDate <= 9) {
	      strDate = "0" + strDate;
	  }
	  let hours = date.getHours();
	  if(hours >=0 && hours <=9){
	      hours = "0" + hours;
	  }
	  let minutes = date.getMinutes();
	  if(minutes >=0 && minutes <=9){
	      minutes = "0" + minutes;
	  }
	  let currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate + ' ' + hours + seperator2 + minutes;
	  return currentdate;
	}

export {
    my_number_format,
    my_date_format
}